/**
 * calendar 汉化
 */


if(Ext.calendar.CalendarPanel){
   Ext.apply(Ext.calendar.CalendarPanel.prototype, {
        todayText: '今天',
	    dayText: '天',
	    weekText: '周',
	    monthText: '月',
	    jumpToText: '跳到：'
   });
}

if(Ext.calendar.CalendarView){
   Ext.apply(Ext.calendar.CalendarView.prototype, {
        ddCreateEventText: '为{0}创建事件',
	    ddMoveEventText: '移动事件到{0}'
   });
}

if(Ext.calendar.DateRangeField){
   Ext.apply(Ext.calendar.DateRangeField.prototype, {
   		allDayText: '是否整天'
   });
}

if(Ext.calendar.CalendarPicker){
   Ext.apply(Ext.calendar.CalendarPicker.prototype, {
   		fieldLabel: '类型'
   });
}

if(Ext.calendar.ReminderField){
   Ext.apply(Ext.calendar.ReminderField.prototype, {
   		fieldLabel: '提醒'
   });
}

if(Ext.calendar.EventEditForm){
   Ext.apply(Ext.calendar.EventEditForm.prototype, {
   		title: '事件表单',
    	titleTextAdd: '添加日程',
    	titleTextEdit: '编辑日程'
   });
}


Date.monthNames = [
   "一月",
   "二月",
   "三月",
   "四月",
   "五月",
   "六月",
   "七月",
   "八月",
   "九月",
   "十月",
   "十一月",
   "十二月"
];

Date.dayNames = [
   "日",
   "一",
   "二",
   "三",
   "四",
   "五",
   "六"
];

Date.formatCodes.a = "(this.getHours() < 12 ? '上午' : '下午')";
Date.formatCodes.A = "(this.getHours() < 12 ? '上午' : '下午')";

if(Ext.util.Format){
   Ext.util.Format.date = function(v, format){
      if(!v) return "";
      if(!(v instanceof Date)) v = new Date(Date.parse(v));
      return v.dateFormat(format || "y年m月d日");
   };
}

if(Ext.DatePicker){
   Ext.apply(Ext.DatePicker.prototype, {
      todayText         : "今天",
      minText           : "日期必须大于最小允许日期",//update
      maxText           : "日期必须小于最大允许日期",//update
      disabledDaysText  : "",
      disabledDatesText : "",
      monthNames        : Date.monthNames,
      dayNames          : Date.dayNames,
      nextText          : '下个月 (Ctrl+Right)',
      prevText          : '上个月 (Ctrl+Left)',
      monthYearText     : '选择一个月 (Control+Up/Down 来改变年份)',//update
      todayTip          : "{0} (空格键选择)",
      format            : "y年m月d日",
      okText            : "确定",
      cancelText        : "取消"
   });
}
